Skip to content

consolidate routed-experts capturer onto reusable base#24403

Merged
hnyls2002 merged 4 commits intomainfrom
lsyin/routed-experts-cleanup
May 5, 2026
Merged

consolidate routed-experts capturer onto reusable base#24403
hnyls2002 merged 4 commits intomainfrom
lsyin/routed-experts-cleanup

Conversation

@hnyls2002
Copy link
Copy Markdown
Collaborator

@hnyls2002 hnyls2002 commented May 5, 2026

Pure refactor of the routed-experts capturer; prep for an upcoming indexer-topk capturer (stacked PR) that reuses the same base.

  • Drop RoutedExpertsCapturer ABC + _RoutedExpertsCapturerNoopcreate() returns Optional[RoutedExpertsCapturer], callers use is not None checks.
  • Extract BaseTopkCapturer / BaseHostCache / BaseDeviceCache / TopkCaptureOutput to python/sglang/srt/layers/topk_capturer_base.py.
  • RoutedExpertsCapturer now inherits BaseTopkCapturer; overrides only _get_local_slice for DP-rank-aware slicing + dropping fused shared experts columns.
  • No user-facing behavior change for enable_return_routed_experts=True; only allocation log strings differ (now tagged HostCache[routed_experts] / DeviceCache[routed_experts]).

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@hnyls2002
Copy link
Copy Markdown
Collaborator Author

/rerun-test test_return_routed_experts.py

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

2-gpu-h100 (1 test): View workflow run

cd test/ && python3 registered/rl/test_return_routed_experts.py

@hnyls2002 hnyls2002 merged commit c4c0376 into main May 5, 2026
148 of 169 checks passed
@hnyls2002 hnyls2002 deleted the lsyin/routed-experts-cleanup branch May 5, 2026 19:41
@hnyls2002 hnyls2002 restored the lsyin/routed-experts-cleanup branch May 6, 2026 02:16
@hnyls2002 hnyls2002 deleted the lsyin/routed-experts-cleanup branch May 6, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant